package com.fesine.learn.design.pattern.structural.facade;

/**
 * @description: 类描述
 * @author: fesine
 * @createTime:2019/4/23
 * @update:修改内容
 * @author: fesine
 * @updateTime:2019/4/23
 */
public class GiftExchangeService {

    private QualifyService qualifyService = new QualifyService();
    private PointsPaymentService pointsPaymentService = new PointsPaymentService();
    private ShippingService shippingService = new ShippingService();

    public void giftExchange(PointsGift pointsGift) {
        //资格校验通过
        if (qualifyService.isAvailable(pointsGift)) {
            //支付成功
            if (pointsPaymentService.pay(pointsGift)) {

                String shippingOrderNo = shippingService.shipGift(pointsGift);
                System.out.println(pointsGift.getName()+"礼品积分兑换成功，物流订单号："+shippingOrderNo);
            }
        }
    }
}
